import request from '../utils/request'

// 获取验证码
export const getCode = (mobile: string) => {
  return request({
    url: '/au/code',
    method: 'POST',
    data: {
      mobile
    }
  })
}

// 登录
export const login = (data: any) => {
  return request({
    url: '/au/login',
    method: 'POST',
    data
  })
}

// 头像上传
export const upload = (file: any) => {
  const formData = new FormData()
  formData.append('files', file)

  return request({
    url: '/upload',
    method: 'POST',
    data: formData,
    isNeedToken: true
  })
}

// 修改用户信息
export const editUser = (data: any) => {
  return request({
    url: '/au/edit',
    method: 'POST',
    data,
    isNeedToken: true
  })
}
